package com.hd.trans.network.bean;

import java.util.Objects;

public class AudioSourceSettings {

    /** 是否录制麦克风声音 */
    public boolean isRecordMic;
    /** 是否录制系统声音 */
    public boolean isRecordSys;

    public AudioSourceSettings(boolean isRecordMic, boolean isRecordSys) {
        this.isRecordMic = isRecordMic;
        this.isRecordSys = isRecordSys;
    }

    public AudioSourceSettings() {
        this(true, false);
    }

    public void put(AudioSourceSettings settings) {
        if (settings == null) {
            return;
        }
        isRecordMic = settings.isRecordMic;
        isRecordSys = settings.isRecordSys;
    }

    public AudioSourceSettings copy() {
        return new AudioSourceSettings(isRecordMic, isRecordSys);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        AudioSourceSettings that = (AudioSourceSettings) o;
        return isRecordMic == that.isRecordMic && isRecordSys == that.isRecordSys;
    }

    @Override
    public int hashCode() {
        return Objects.hash(isRecordMic, isRecordSys);
    }
}
